package com.srzk.youthleagueback.mapper;

import com.srzk.youthleagueback.entity.po.Student;
import java.util.List;

import org.apache.ibatis.annotations.*;

@Mapper
public interface StudentMapper {
    @InsertProvider(value = StudentProvider.class,method = "insert")
    int insert(Student record);

    @Select("select * from student where username = #{username}")
    Student selectByPrimaryKey(@Param("username") String username);

    @Select("select * from student")
    List<Student> selectAll();

    @UpdateProvider(value = StudentProvider.class,method = "update")
    int updateByPrimaryKey(Student record);

    @Select("select * from student where cla = #{cla} and dname = #{dname} and grade = #{grade})")
    List<Student> selectByclass(String cla,String dname,String grade);

    @Delete("delete student where username = #{username}")
    int deleteByUsername(String username);
}